package fr.p10.miage.applianceTest;

import org.testng.AssertJUnit;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import fr.upo.miage.dp.state.appareil.ApplianceCommunicationException;
import fr.upo.miage.dp.state.appareil.Toaster;
import fr.upo.miage.dp.state.appareil.state.ApplianceState;

public class TestApplianceOFFtoON extends TestRoot{

	@BeforeClass
  	public static void setUp(){
	  initialState = ApplianceState.OFF;
	  toaster = new Toaster (initialState);
	}
	
	@Test 
	public void testIsOFF(){
		current = toaster.getState(); 
		AssertJUnit.assertEquals(ApplianceState.OFF, current);
	}
	
	@Test
	public static void testOffToOn() throws ApplianceCommunicationException{
		toaster.turnOn();
		current = toaster.getState();
		AssertJUnit.assertEquals(ApplianceState.ON, current);
	}
}
